import signInLess from "./index.module.less";
import { useNavigate } from "react-router-dom";
import { useSelector, useDispatch } from "react-redux";
import { showModal } from "@/store/modules/user";
function SignIn() {
  const navigate = useNavigate();
  const dispatch = useDispatch();

  const UserId = useSelector((state: any) => state.user.UserId);
  const SignIn = () => {
    if (UserId) {
      navigate("/signIn/signInTime");
    } else {
      dispatch(showModal());
    }
  };
  return (
    <>
      <div className={signInLess.sign_content}>
        <div className="left_title_sign">
          <div className="sign_title">限时领掘金会员</div>
          <div className="desc">点亮在社区的每一天</div>
        </div>
        <div className="right_btn_sign">
          <div className="sign_btn" onClick={SignIn}>
            去签到
          </div>
        </div>
      </div>
    </>
  );
}

export default SignIn;
